package org.yuning.cloud.app.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.yuning.cloud.starter.EnableYuNingCloud;
import org.yuning.cloud.starter.configuration.ApplicationHolder;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhangzz
 * @email 291110369@qq.com
 * @date 2023/11/9 17:11
 * @description
 **/
@SpringBootApplication
@EnableYuNingCloud
@RestController
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
        System.out.println(ApplicationHolder.getApplicationContext());
    }

    @GetMapping("demo")
    @ResponseBody
    public String test() {
        return "demo";
    }

    @GetMapping("map")
    public Map<String,Object> map() {
        Map<String,Object> map = new HashMap<>();
        map.put("name", "zhangsan");
        map.put("age", 12);
        return map;
    }

}
